home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc International / Development / TSMTEsample⁄1.1 / _SOM_ / som_SamplePart.xh < prev    next >
Encoding:
Text File  |  1996-11-14  |  3.9 KB  |  168 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: som_SamplePart.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. #ifndef SOM_Module_SampleCode_defined
  11. #define SOM_Module_SampleCode_defined 1
  12. #include <som.xh>
  13.  
  14. /*
  15.  * Start of user-defined types:
  16.  */
  17. class SOMClass;
  18. class SOMObject;
  19. class ODFrame;
  20. class ODFacet;
  21. class ODObject;
  22. class ODExtension;
  23. class ODRefCntObject;
  24. class ODPersistentObject;
  25. class ODStorageUnit;
  26. class ODPart;
  27. class ODCanvas;
  28. class ODDragItemIterator;
  29. class ODEmbeddedFramesIterator;
  30. class ODLink;
  31. class ODLinkSource;
  32. class ODObjectSpec;
  33. class ODShape;
  34. class ODStorageUnitView;
  35. class ODTypeList;
  36.  
  37. /*
  38.  * End of user-defined types.
  39.  */
  40. #endif /* SOM_Module_SampleCode_defined */
  41.  
  42. #ifndef SOM_SampleCode_som_SamplePart_xh
  43. #define SOM_SampleCode_som_SamplePart_xh
  44.  
  45. class SampleCode_som_SamplePart;
  46.  
  47. #define SampleCode_som_SamplePart_MajorVersion 1
  48. #define SampleCode_som_SamplePart_MinorVersion 2
  49.  
  50. /* C++ SOM defs */
  51. #include <somcls.xh>
  52. #include <somcm.xh>
  53.  
  54. /* C++ parent defs */
  55. #ifndef SOM_ODPart_xh
  56. #include <Part.xh>
  57. #endif
  58.  
  59. #ifndef SampleCode_som_SamplePart_API
  60. #define SampleCode_som_SamplePart_API
  61. /*
  62.  * -- The Class API
  63.  */
  64.  
  65. /*
  66.  * Start of user-defined types:
  67.  */
  68.  
  69. /*
  70.  * End of user-defined types.
  71.  */
  72.  
  73. #ifdef OLDIBMSOMAPISUPPORT
  74. #define SampleCode_som_SamplePartCClassData SampleCode_som_SamplePartClassData
  75. #define SampleCode_som_SamplePartNewClass(major,minor) somNewVersionedClassReference(SampleCode_som_SamplePart,major,minor)
  76. #endif
  77.  
  78. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  79. #define SampleCode_som_SamplePartMetaClass SOMClass
  80.  
  81. #if PRAGMA_ALIGN_SUPPORTED
  82. #  pragma options align=power
  83. #endif
  84.  
  85. /* The API to the SampleCode_som_SamplePart class object, and the methods it introduces. */
  86. SOMEXTERN struct SampleCode_som_SamplePartClassDataStructure {
  87. #ifdef OLDIBMSOMAPISUPPORT
  88.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  89. #else
  90.     long zero;
  91. #endif
  92.     somStaticClassInfo *sci;
  93.     somDToken        instanceDataToken;
  94.     long reserved [3];
  95. } SOMDLINK SampleCode_som_SamplePartClassData;
  96.  
  97. #if PRAGMA_ALIGN_SUPPORTED
  98. #  pragma options align=reset
  99. #endif
  100.  
  101. #if !defined(SampleCode_som_SamplePart_Class_Source) && !defined(SOM_Module_som_samplepart_Source)
  102. #if PRAGMA_IMPORT_SUPPORTED
  103. #pragma import list SampleCode_som_SamplePartClassData
  104. #endif
  105. #endif
  106.  
  107.  
  108. /*
  109.  * -- Typedefs and inline method declarations for left path inherited methods
  110.  * -- are omitted because this compilation had -museinheritedmethods in effect
  111.  */
  112.  
  113.  
  114. /*
  115.  * -- Typedefs for SampleCode_som_SamplePart Method Procedures
  116.  */
  117. SOMEXTERN {
  118. }
  119.  
  120. #endif /* SampleCode_som_SamplePart_API */
  121.  
  122.  
  123. /*
  124.  * -- This emitter treats Method Tokens as Thunks by default.
  125.  * -- Use the sc modifier "nothunks" to change this default
  126.  */
  127. #undef somresolve_
  128. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  129.  
  130. /*
  131.  * -- The C++ Wrapper Class for SampleCode_som_SamplePart
  132.  */
  133. class SampleCode_som_SamplePart : public ODPart
  134. {
  135. public:
  136.  
  137. // SampleCode_som_SamplePart::new registers use of the class object, and then uses somNew
  138. // to allocate memory and load the object method table pointer. 
  139. void *operator new(size_t size)
  140. {
  141.     SOM_IgnoreWarning(size);
  142.     // Allocate memory using the default allocator for SampleCode_som_SamplePart, and
  143.     // clear mem & set method table pointer, call basic initialization
  144. #ifdef SOMCHKNULL
  145.     void * __somResult = (void *)
  146.       somNewObject(SampleCode_som_SamplePart);
  147.     SOMCHKNULL(__somResult);
  148.     return __somResult;
  149. #else
  150.     return (void*) somNewObject(SampleCode_som_SamplePart);
  151. #endif
  152. }
  153.  
  154. // SampleCode_som_SamplePart::delete uses the default deallocator for the object's class.
  155. void operator delete(void * obj)
  156. {
  157.     if (obj) {
  158.         SOM_Resolve(obj,SOMObject,somFree)
  159.            ( (SOMObject*) obj );
  160.     }
  161. }
  162.  
  163. };   /* SampleCode_som_SamplePart */
  164.  
  165.  
  166.  
  167. #endif       /* SOM_SampleCode_som_SamplePart_xh */
  168.